package com.twu.biblioteca;

public class UserLoginCommand implements Command {
    private final Library library;

    public UserLoginCommand(Library library) {
        this.library = library;
    }

    public String call(Object[] arguments) {
        boolean success = library.authenticate(arguments[0].toString(), arguments[1].toString());

        if (success) {
            return "Login successful. Welcome!\n";
        }

        return "Wrong credentials. Please try again.\n";
    }
}